<template>
  <div>
    <h1>父组件</h1>
    <!-- 1. 父传。自定义属性 -->
    <MyCom :abc="userName" :list="products" @abc_fn="abc_fn" />
    {{ userId }}
  </div>
</template>
<script>
// 导入->注册->使用
import MyCom from './demoPropchildren.vue'
export default {
  components: { MyCom },
  data() {
    return {
      userName: '2007',
      userId: undefined,
      products: [{ productName: 'iphone 12', productPic: 'xxx.png' }]
    }
  },
  methods: {
    abc_fn(obj) {
      console.log('abc_fn子组件发生了abc事件', obj)
      this.userId = obj
    }
  }
}
</script>
